package com.main.ok.test;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class SleepZuo implements Runnable {
    static ScheduledExecutorService service = Executors.newScheduledThreadPool(1);

    public static void main(String[] args) {
        Thread t = new Thread(new SleepZuo(), "curr");
        t.setName("xxx");
        service.scheduleAtFixedRate(t, 0, 5, TimeUnit.SECONDS);
    }

    @Override
    public void run() {
        // TODO Auto-generated method stub
        try {
            System.out.println(Thread.currentThread().getName());
            Thread.sleep(10000l);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
